package com.service.impl;

import com.entity.query.QueryOrder;
import com.entity.query.QueryResult;
import com.mappers.OrderMapper;
import com.service.impl.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by bruce on 2016/5/22.
 */
@Service
public class OrderServiceImpl implements OrderService{

    @Autowired
    OrderMapper orderMapper;


    public QueryResult queryOrder(QueryOrder queryOrder) {

        QueryResult result = new QueryResult();
        result.setPage(queryOrder.getPage());
        result.setPageSize(queryOrder.getPageSize());
        result.setTotalRecord(orderMapper.findOrderCount(queryOrder));
        result.setData(orderMapper.findOrderList(queryOrder));

        return result;
    }

}
